package com.gxa.medical.service.impl;

import com.gxa.medical.mapper.TalkMapper;
import com.gxa.medical.pojo.Talk;
import com.gxa.medical.service.TalkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional(rollbackFor = {Throwable.class})
public class TalkServiceImpl implements TalkService {
    @Autowired
    TalkMapper talkMapper;

    @Override
    public List<Map<String, Object>> selectAllByPage(Integer page, Integer size) {
        return talkMapper.selectAllByPage((page-1)*size,size);
    }

    @Override
    public Integer insert(Talk discuss) {
        return talkMapper.insert(discuss);
    }

    @Override
    public Integer delectById(Integer id) {
        return talkMapper.delectById(id);
    }

    @Override
    public List<Map<String, Object>> selectById(Integer id) {
        return talkMapper.selectById(id);
    }

    @Override
    public List<Map<String, Object>> selectAllByim() {
        return talkMapper.selectAllByim();
    }

    @Override
    public List<Map<String, Object>> selectAllByNa() {
        return talkMapper.selectAllByNa();
    }

    @Override
    public List<Map<String, Object>> selectByLike(String name, String sigstaTime, String sigoverTime, Integer isud, Integer page, Integer size) {
        return talkMapper.selectByLike(name,sigstaTime,sigoverTime,isud,(page-1)*size,size);
    }

    @Override
    public Integer selectByDocName(String name) {
        return talkMapper.selectByDocName(name);
    }

    @Override
    public void insertDT(Integer doc_id, Integer talk_id) {
        talkMapper.insertDT(doc_id, talk_id);
    }

    @Override
    public void insertInD(Integer invite_doc_id, Integer talk_id) {
        talkMapper.insertInD(invite_doc_id, talk_id);
    }

    @Override
    public void insertTPS(Integer tid, Integer did) {
        talkMapper.insertTPS(tid, did);
    }

    @Override
    public Integer selectByUserName(String name) {
        return talkMapper.selectByUserName(name);
    }

    @Override
    public void insertUT(Integer user_id, Integer talk_id) {
        talkMapper.insertUT(user_id, talk_id);
    }

    @Override
    public List<Map<String, Object>> selectByI(Integer id) {
        return talkMapper.selectByI(id);
    }

    @Override
    public Integer selectCon() {
        return talkMapper.selectCon();
    }

    @Override
    public Integer selectConLike() {
        return talkMapper.selectConLike();
    }
}
